package ErbeDesKoenigs;
import javax.swing.JFrame;

public class ProgrammWindow extends JFrame {
	Surface surface[] = new Surface[ErbeDesKoenigs.playerCount];
	public Playground playground;
	
	public ProgrammWindow() {
		this.setLayout(null);
		this.setSize(ErbeDesKoenigs.windowX, ErbeDesKoenigs.windowY);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setResizable(false);
		this.setVisible(true);
	}
	
	public void createSurfaces(){
		playground = new Playground();
		playground.setLocation(0, 0);
		this.add(playground);
		for (int i = 0; i < surface.length; i++) {
			surface[i] = new Surface(i);
			surface[i].setLocation(0, ErbeDesKoenigs.windowY/2);
			this.add(surface[i]);
		}
		surface[ErbeDesKoenigs.activePlayer].setVisible(true);
		repaint();
	}
	
	public void showActivePlayer(){
		for (int j = 0; j < surface.length; j++) {
			surface[j].setVisible(false);;
		}
		surface[ErbeDesKoenigs.activePlayer].setVisible(true);
		repaint();
	}
}